<div class="password-item">
    <input type="password" class="am-form-field old" placeholder="请输入旧密码" />
</div>

<div class="password-item">
    <input type="password" class="am-form-field p1" placeholder="请输入新密码" />
</div>

<div class="password-item">
    <input type="password" class="am-form-field p2" placeholder="请再次输新密码" />
</div>

<div class="button2 bank">
    <button type="button" class="am-btn am-btn-primary btn-save">确定修改</button>
</div>
<style type="text/css">
    .password-item {
        margin: 10px 15px 10px 15px;
    }
    .password-item input {
        border: 1px solid #191919;
        color: #000;
        border-radius: 4px;
        background-color: #fff;
        color: #000;
    }
</style>

<script>
    $(".bank .btn-save").click(function() {
        var old = $(".old").val().trim(),
            p1 = $(".p1").val().trim(),
            p2 = $(".p1").val().trim();
        if (old == '') {
            alert2("请输入旧密码！");
            return;
        }
        if (p1 == '') {
            alert2("请输入新密码！");
            return;
        }
        if (p2 == '') {
            alert2('请再次输入新密码！');
            return;
        }
        if (p1 != p2) {
            alert2("两次密码不匹配，请重新输入！");
            return;
        }

        startLoading();
        CMD.modify_password(p1, old, function() {
            stopLoading();
            alert2("密码修改成功！");
        }, function(message) {
            stopLoading();
            alert2(message || '密码修改失败！');
        });
    });
</script>